﻿@using Kugar.AdminLte.Core.Test.Models.Home
@using Kugar.Core.ExtMethod
@using Kugar.UI.Web.AdminLTE.Enums
@using Kugar.UI.Web.AdminLTE.Helpers
@using Kugar.UI.Web.AdminLTE.PageControls.PageCommon
@using Newtonsoft.Json.Linq
@using Kugar.UI.Web.AdminLTE.PageControls.Helpers.ButtonExtMethod

@model Kugar.AdminLte.Core.Test.Models.Home.Model_List

@{
    Layout = null;
}

<script>
</script>

@using (var dp = WebUI.Control.DataPicker<TableTest>().Title("DataPicker").MultiSelect()
    .ContentWidth(800).ContentHeight(600)
    .Render())
{
    dp.FilterBlock.ColQty(QueryBoxColCount.Col_3).HideQueryButton()
        .AddHiddenValue("hid", "123")

        .AddSelector(x => x.BoxItemLabel("selector").Name("first").Options(new[]
        {
            new SelectorItem("000", "0"),
            new SelectorItem("001", "1"),
            new SelectorItem("002", "2")
        }).FirstItem("全部", "-1").CurrentValue(2))

        .AddDateTimeRange(x => x.BoxItemLabel("daterange").ValueLimit(DateTime.Now.AddDays(-5), DateTime.Now.AddDays(5)).Type(DatetimePickerType.Date).Name("sDT", "eDT").Value(null, null))

        .AddTextBoxWithButton(x => x.BoxItemLabel("keyword").Name("keyword").PlaceHolder("input keyword").SelectedOnClick().ButtonType(ButtonTypeEnum.submit).ButtonText("search").ButtonIconCss(""))

        .AddTextBox(x => x.BoxItemLabel("textbox").Value("aaa").Name("txt").SelectedOnClick())
        .AddButton(x => x.Text("search").Color(ColorPaletteEnum.info).Type(ButtonTypeEnum.submit))

        .Render();

    using (var tbl = dp.Table(Model.Data, x => JObject.FromObject(x)).NoWrap().Render())
    {
        @tbl.Columns.AddIndex()

        @tbl.Columns.AddLabel().ColumnTitle("UserName1").Value(x => x.UserName1)

        @tbl.Columns.AddLabel().ColumnTitle("UserName2").Value(x => x.UserName2)

        @tbl.Columns.AddLabel().ColumnTitle("UserName3").Value(x => x.UserName3.ToStringEx("yyyy-MM-dd"))

        @tbl.Columns.AddLabel().ColumnTitle("UserName4").Value(x => x.UserName4.ToString())

        @tbl.Columns.AddLabel().ColumnTitle("UserName5").Value(x => x.UserName5)

        @tbl.Columns.AddLabel().ColumnTitle("UserName6").Value(x => x.UserName6)

        @tbl.Columns.AddLabel().ColumnTitle("UserName7").Value(x => x.UserName7)

        @tbl.Columns.AddLabel().ColumnTitle("UserName8").Value(x => x.UserName8)
    }
}